﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Com.Crc.ResManage.BLL.EquipManage;
using Com.App_Code;
using Infragistics.WebUI.UltraWebGrid;
using System.Collections;


namespace Com.Crc.WorkFormManage.Web
{
    public partial class WorkFormQuery : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
            }
        }

        protected void btn_query_workform(object sender, EventArgs e)
        {
            Crc.WFManage.BLL.WorkFormManage.WFWLANManageBLL bll = new Crc.WFManage.BLL.WorkFormManage.WFWLANManageBLL();
            DataTable dt = bll.queryBy(int.Parse(this.workformType.SelectedValue), account.Text.Trim());
            BindData(dt);
        }

        protected void grd_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
        {
            grd.Bands[0].Columns.Clear();

            int i = 0;
            base.AddGridCheckColumn(this.grd, i++, grd.ClientID);
            base.AddGridColumn(this.grd, "N_ID", "N_ID", 80, i++, true);
            base.AddGridColumn(this.grd, "工单类型", "N_TYPE", 80, i++, false);
            base.AddGridColumn(this.grd, "接入方式", "N_IN_TYPE", 80, i++, false);
            base.AddGridColumn(this.grd, "接入局点", "N_STATION_ID", 80, i++, false);
            base.AddGridColumn(this.grd, "用户账号", "S_ACCOUNT", 80, i++, false);
            base.AddGridColumn(this.grd, "用户带宽", "S_DK", 80, i++, false);
            base.AddGridColumn(this.grd, "用户姓名", "S_NAME", 80, i++, false);
            base.AddGridColumn(this.grd, "联系电话", "S_TEL", 80, i++, false);
            base.AddGridColumn(this.grd, "地址类型", "S_ADDRESS_TYPE", 80, i++, false);
            base.AddGridColumn(this.grd, "地址区域ID", "N_AREA_ID", 80, i++, false);
            base.AddGridColumn(this.grd, "用户地址", "S_ADDRESS", 80, i++, false);
            base.AddGridColumn(this.grd, "端口", "N_PORT", 80, i++, false);
            base.AddGridColumn(this.grd, "接入新村", "N_IN_AREA", 80, i++, false);
            base.AddGridColumn(this.grd, "原有账号", "S_ORG_ACCOUNT", 80, i++, false);
            base.AddGridColumn(this.grd, "状态", "S_STATE", 80, i++, false);
            base.AddGridColumn(this.grd, "操作人ID", "N_OPER_ID", 80, i++, false);
            base.AddGridColumn(this.grd, "操作时间", "D_DATE", 80, i++, false);
            base.AddGridColumn(this.grd, "备注", "S_BAK", 80, i++, false);
            base.AddGridColumn(this.grd, "是否是老用户改装", "S_TO_UPDATE", 80, i++, false);
            base.AddGridImageColumn(grd, "编辑", "Edit", 40, i++, "~/img/icon_edit.gif");
        }

        private void BindData(DataTable dt)
        {
            grd.DataSource = dt;
            grd.DataBind();
        }

        protected void grd_PageIndexChanged(object sender, Infragistics.WebUI.UltraWebGrid.PageEventArgs e)
        {

        }

    }
}